<template>
  <div id="app" :class="skin" class="indexPage">
    <router-view></router-view>
  </div>
</template>

<script>
  import { mapGetters } from 'vuex'
  import { removeToken } from '@/utils/auth'
  export default {
    computed: {
      ...mapGetters([
        'skin',
      ]),
    },
    name: 'app',
    data() {
      return {
      }
    },
    created() {
      if (localStorage.getItem('skin')) {
        this.$store.commit('SET_SKIN', localStorage.getItem('skin'))
      } else {
        this.$store.commit('SET_SKIN', 'skin_blue')
        localStorage.setItem('skin', 'skin_blue')
      }
      if (sessionStorage.memberAlreadlogIn) {
        localStorage.memberAlreadlogIn = JSON.stringify(sessionStorage.memberAlreadlogIn)
      }
      window.addEventListener('beforeunload', e => {
        localStorage.removeItem('memberAlreadlogIn')
      })
      window.addEventListener('unload', e => {
        localStorage.removeItem('memberAlreadlogIn')
      })
    },
    mounted() {
      window.onbeforeunload = function(e) {
        var storage = window.localStorage
        storage.clear()
      }
    },
  }
</script>
<style>
  html,body{
    overflow-y: hidden;
    height:100%;
    min-width:1300px;
    min-height:900px;
  }
  .indexPage{
    overflow: hidden;
    height: 100%;
  }
</style>
